<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<ul id="riskTab" class="contListTab mt10">
    <li onclick="javascript:$('#jobReferenceMenu').click();" class="selectContListTab"><a href="javascript:void(0);">Add Job Reference</a></li>
	<li onclick="javascript:jobReference.list(0);"><a href="javascript:void(0);">Job Reference List</a></li>
</ul>
<div id="riskTabCnt">
    <!-- Add Job Reference -->
	<div class="pad10">
        <input type="hidden" id="jobReferenceId"/>
        <ul class="mode_add">
			<li>
			    <label>Subject:</label>
			    <input type="text" id="subject" class="input_txt" size="60" maxlength="100"/>
			</li>
			<li>
			    <label>Light soure:</label>
			    <input type="text" id="lightSoure" class="input_txt" size="60" maxlength="100"/>
			</li>
			<li class="wrap_flow">
                <label style="float:left">Image:</label>
                <div style="padding-left: 118px;">
	                <form method="POST" enctype="multipart/form-data" id="jobReferenceImageForm" style="float:left;"> 
	                    <input type="hidden" name="filePath" value="file/jobReference"/>
	                    <input type="hidden" name="width" value="250"/>
	                    <input type="hidden" name="height" value="180"/>
	                    <input type="file" name="file" id="file" onchange="javascript:$('#jobReferenceImageForm').submit();"/>
	                </form>
                    <font style="float:left;" color="red">Image Size: 250 x 180</font>
                </div>
                <input type="hidden" id="jobReferenceFilePath"/>
			</li>
			<li>
			    <label>Image Preview:</label>
			    <img style="width:250px;height:180px;" id="jobReferenceImage" src="">
			</li>
			<li>
			    <label>&nbsp;</label>
			    <input type="button" id="jobReferenceButton" onclick="javascript:jobReference.create();" value="Add" class="blueBtn" />
			</li>
		</ul>
	</div>
	
    <!-- Job Reference List -->
    <div class="pad10" style="display: none;">
        <table class="listTable tac mar10">
            <thead>
                <tr>
                    <th>Subject</th>
                    <th>Light soure</th>
                    <th>Create Date</th>
                    <th>Operation</th>
                </tr>
            </thead>
            <tbody id="jobReferenceList">
            </tbody>
        </table>
        <br/>
        <div id="paginationDiv"></div>
    </div>
</div>

<script type="text/javascript" src="js/jobReference.js"></script>
<script type="text/javascript" src="js/upload.js"></script>
<script type="text/javascript">
$(document).ready(function() {
    //切换
    switchTab("riskTab","riskTabCnt","div","selectContListTab");
    
    upload.uploadImage('jobReference');

    var jobReferenceId = '<%=request.getParameter("jobReferenceId")%>';

    if(jobReferenceId!=null&&jobReferenceId!='null'){
        $('#jobReferenceButton').click(function(){
            jobReference.create('update');
        });
        jobReference.modify(jobReferenceId);
    }else{
        $('#jobReferenceButton').click(function(){
        	jobReference.create('create');
        });
    }
});
</script>
<script type="text/javascript">
</script>
